package co.qingke.resteasy.spring.server;


import java.util.Date;

import org.springframework.stereotype.Component;

import co.qingke.resteasy.spring.model.Gender;
import co.qingke.resteasy.spring.model.HelloMessage;
import co.qingke.resteasy.spring.model.HelloResponse;

@Component
public class HelloSpringService {
	
	  public String sayTextHello(String msg) {
	        return msg + " --> Hello";
	    }

	    public HelloResponse sayJavaBeanHello(HelloMessage msg) {
	        return new HelloResponse(msg.getMsg() + " --> Hello "
	                + (msg.getGender() == Gender.MALE ? "Sir" : "Madam"),
	                new Date());
	    }
}
